#include "stdafx.h"
#include "localmaxima.h"
#include <vector>


void findLocalMax(const double* signal, unsigned int signalSize, std::vector<LocalMax>& out, float tresh, unsigned int padding){
	for (auto cur = padding + 1; cur < signalSize + padding - 1; cur++){
		if (signal[cur] > signal[cur - 1] && signal[cur] >= signal[cur+1]){
			if (signal[cur] >= tresh){
				out.push_back(LocalMax{ cur, signal[cur] });
			}
		}
	}
}